<div id="dashboardContainer">
  <div id="pageContent">
    <%= render 'layouts/form_menu' %>
    <div id="equityMain">
      <div class="equityTable">

<h1>Edit Patient Condition</h1>
<h2><%=@eqcondition.name %></h2>
<h2 align="right"><%=@patient.firstname %> <%=@patient.lastname %></h2>
<h2 align="right">Member ID: <%=@patient.member_id %></h2>
<h5><%= flash[:notice] %><br />
  <% @hcv.errors.full_messages.each do |msg| %>
  - <%= msg %><br />
  <% end %>
</h5>
<% if @guidelines.length > 0 %>
<table id="conditionTable" >
   <tr>
     <th colspan="2">Risk: You are at risk for HCV infection!</th>
   </tr>
  <% @guidelines.each do |g| %>
  <tr>
    <td width="20">CDC Guideline: </td>
    <td>Population: <%=g.cause %><br />
       Testing: <%=g.test_rec %> <br />
       Vaccination/Follow-up: <%=g.treat_rec %>
    </td>
  </tr>
  <tr><th colspan="2">  </th></tr>
  <% end %>
</table>
<% end %>
<table id="conditionTable" >
  <% if @test_alert %>
    <caption>***ALERT: <%=@test_alert %>***</caption>
  <% end %>
  <tr>
    <th colspan="2">Tests: <%= @test_status %>    </th>
  </tr>
  <%= form_tag("/conditions/hcv/update/"+@patient.id.to_s+"/"+@eqcondition.id.to_s, :method => :post) do %>
  <tr>
    <td >Anti-HCV:</td>
    <td>
      <%= check_box(:hcv, :anti_hcv_pos, {}, true, false) %> Postive
      <%= check_box(:hcv, :anti_hcv_neg, {}, true, false) %> Negative
      &nbsp;Date: <%= text_field(:hbv, :anti_hcv_date, :size => 10) %>
    </td>
  </tr>
  <tr>
    <td>HCV-Riba:</td>
    <td>
      <%= check_box(:hcv, :hcv_riba_pos, {}, true, false) %> Postive
      <%= check_box(:hcv, :hcv_riba_neg, {}, true, false) %> Negative
      &nbsp;Date: <%= text_field(:hbv, :hcv_riba_date, :size => 10) %>
    </td>
  </tr>
  <tr>
    <td>HCV-RNA:</td>
    <td>
        <%= check_box(:hcv, :hcv_rna_pos, {}, true, false) %> Postive
        <%= check_box(:hcv, :hcv_rna_neg, {}, true, false) %> Negative
        &nbsp;Date: <%= text_field(:hcv, :hcv_rna_date, :size => 10) %>
      </td>
  </tr>
  <tr><th colspan="2">  </th></tr>
  <tr><td></td>
    <td><%= submit_tag("Save") %>  </td>
  </tr>
  <% end %>
</table>
<table id="conditionTable" >
  <% if @treatment_alert %>
    <caption>***ALERT: <%=@treatment_alert %>***</caption>
  <% end %>
  <tr>
    <th colspan="5">Treatment History:</th>
  </tr>
  <tr>
    <td>Medication Name</td>
    <td>Start Date</td>
    <td>End Date</td>
    <td>Reason</td>
    <td></td>
  </tr>
  <% @eqcondition.eqtreatments.each do |tr| %>
    <tr>
      <td><%= tr.medname %></td>
      <td><%= tr.start %></td>
      <td><%= tr.end %></td>
      <td><%= tr.note %></td>
      <td><%= link_to "[remove]", remove_condition_treatment_path(@patient.id, @eqcondition.id, tr.id) %></td>
    </tr>
  <% end %>
  <% @eqcondition.eqtreatments.new do |tr| %>
    <%= form_tag("/conditions/treatment/add/"+@patient.id.to_s+"/"+@eqcondition.id.to_s, :method => :post) do %>
    <tr>
      <td><%= text_field(:tr, :medname) %></td>
      <td><%= text_field(:tr, :start, :size => 10) %></td>
      <td><%= text_field(:tr, :end, :size => 10) %></td>
      <td><%= text_field(:tr, :note) %></td>
      <td><%= submit_tag("Add") %>  </td>
    </tr>
    <% end %>
  <% end %>
</table>
<div align="right"><%= link_to "[remove this condition]", remove_condition_path(@patient.id, @eqcondition.id) %></div>
      </div><!-- end #measureDetailTable -->
    </div><!-- end #dashboardPeriod -->
  </div><!-- end #pageContent -->
</div><!-- end #container -->

